import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

// 全局引入cookie
import cookie from 'react-cookies'

// 全局引入路由
import * as router from 'react-router-dom';

// 全局引入UI框架
import * as vant from 'react-vant'

// 全局API请求
import api from './api/index.js'

// 设置全局UI框架
React.$Vant = vant

// 设置全局API
React.$api = api

// 设置全局cookie
React.$LoginUser = cookie.load('LoginUser') ? cookie.load('LoginUser') : {}

// 设置全局路由
React.$router = router
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
